package cn.cool.types.enums;

import cn.cool.types.exception.AppException;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum ActivityStatusEnumVO {
    CREATE(0, "创建"),
    EFFECTIVE(1, "生效"),
    OVERDUE(2, "过期"),
    ABANDONED(3, "丢弃"),
    ;


    private final Integer code;
    private final String info;

    public static ActivityStatusEnumVO valueOf(Integer code) {
        for (ActivityStatusEnumVO value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        throw new AppException("error code is not exists" + code);
    }

}
